package PTA2.ti62;

import java.util.Scanner;

/**
 * @author Lenovo
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();
        int max=Integer.MIN_VALUE;
        int min=Integer.MAX_VALUE;
        int sum=0;
        for (int i=0;i<n;i++){
            int num=scanner.nextInt();
            if(num>max){
                max=num;
            }
            if(num<min){
                min=num;
            }
            sum+=num;
        }
        System.out.println(max);
        System.out.println(min);
        System.out.println(sum);
        scanner.close();
    }
}
